package aa;

/**
 * 三轮电动车，继承于 ElectricVehicles
 */
public class ThreeWheeler extends ElectricVehicles {
    // 新增属性
    private int carriageCapacity;    // 车厢容量
    private boolean hasRoof;         // 是否有顶棚

    // 构造方法，不使用 super 调用父类构造方法
    public ThreeWheeler(String vehicleName, String vehicleNumber, double batteryCapacity,
                        String batteryType, double maxRange, double maxSpeed, double price,
                        int carriageCapacity, boolean hasRoof) {
        super(vehicleName, vehicleNumber, batteryCapacity, batteryType, maxRange, maxSpeed, price);
        this.carriageCapacity = carriageCapacity;
        this.hasRoof = hasRoof;
    }

    // Getter 和 Setter 方法
    public int getCarriageCapacity() {
        return carriageCapacity;
    }

    public void setCarriageCapacity(int carriageCapacity) {
        this.carriageCapacity = carriageCapacity;
    }

    public boolean isHasRoof() {
        return hasRoof;
    }

    public void setHasRoof(boolean hasRoof) {
        this.hasRoof = hasRoof;
    }

    // 重写 toString 方法，返回车辆名称
    @Override
    public String toString() {
        return "三轮车类{" +
                "车辆名称='" + getVehicleName() + '\'' +
                '}';
    }
}
